import request from '@/utils/request'

// 查询Grade列表
export function listGrade(query) {
  return request({
    url: '/api/v1/sys-class',
    method: 'get',
    params: query
  })
}

// 新增
export function addGrade(data) {
  return request({
    url: '/api/v1/sys-class',
    method: 'post',
    data: data
  })
}

// 修改
export function updateGrade(data) {
  return request({
    url: '/api/v1/sys-class',
    method: 'put',
    data: data
  })
}

// 删除
export function delGrade(data) {
  return request({
    url: '/api/v1/sys-class',
    method: 'delete',
    data: data
  })
}

// 修改状态
export function updateStatusGrade(data) {
  return request({
    url: '/api/v1/sys-class/status',
    method: 'put',
    data: data
  })
}

// 班级学员
export function getListByClassId(query) {
  return request({
    url: '/api/v1/sys-student/getListByClassId',
    method: 'get',
    params: query
  })
}

// 移除学员
export function deleteStudent(data) {
  return request({
    url: '/api/v1/sys-class/deleteStudent',
    method: 'post',
    data: data
  })
}

// 未分配班级学员
export function getNoClassStudents(query) {
  return request({
    url: '/api/v1/sys-student/getNoClassStudents',
    method: 'get',
    params: query
  })
}

// 班级添加学员
export function addStudent(data) {
  return request({
    url: '/api/v1/sys-class/addStudent',
    method: 'post',
    data: data
  })
}
